<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let obj1={
            name:"james",
            age:20,
            gender:"male"
        }
        console.log(obj1.name)
        obj1.sayHello=function(x){
            console.log(x)
        }
        obj1.sayHello("你好")
        console.log(obj1)

        let obj2=new Object()
        obj2.name="lucy"
        obj2.age=20
        obj2.gender="female"
        obj2.sayHi=a=>{
            console.log(a)
        }
        obj2.sayHi("Hi")
        let name=prompt("请问你叫什么名字")
        let age=prompt("请问你的年龄")
        let gender=prompt("请问你的性别")
        function Person(name,age,gender){
            this.name=name
            this.age=age
            this.gender=gender
        }
        let p=new Person(name,age,gender)
        console.log(p.name)
        console.log(p)
    </script>
</body>
</html>